#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>


struct Stu
{
	char name[30];
	int age;
};



int cmp_stu_name(void const* p1, void const* p2)
{
	return strcmp(((struct Stu*)p1)->name, ((struct Stu*)p2)->name);
}

int cmp_stu_age(void const* p1, void const* p2)
{
	return ((struct Stu*)p1)->age- ((struct Stu*)p2)->age;
}






int main()
{
	struct Stu arr[] = { {"ZhangSan",18},{"LiSi",20},{"WangWu",19} };
	int sz = sizeof(arr) / sizeof(arr[0]);
	qsort(arr, sz,sizeof(arr[0]), cmp_stu_name);
	qsort(arr, sz, sizeof(arr[0]), cmp_stu_age);
	
	return 0;
}